package com.abc.qq.view.udp;

import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.SocketException;

public class Client {
    public static void main(String[] args) {
        try {
            DatagramSocket datagramSocket = new DatagramSocket();
            String msg = "abchelloworld";
            DatagramPacket dp = new DatagramPacket(msg.getBytes(), msg.length(), InetAddress.getLocalHost(), 8888);
            datagramSocket.send(dp);
            datagramSocket.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
